<!DOCTYPE html>
<html>

<head>
    <base href="/">
    <title>用户登录</title>
    <script src="static/js/global-functions.js"></script>
    <style>
        .container {
            max-width: 400px;
            margin: 50px auto;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        .form-group {
            margin-bottom: 15px;
        }

        input[type="text"],
        input[type="password"] {
            width: 100%;
            padding: 8px;
            margin-top: 5px;
            box-sizing: border-box;
        }

        .btn-login {
            background-color: #4CAF50;
            color: white;
            padding: 10px 20px;
            border: none;
            cursor: pointer;
            width: 100%;
        }

        .flashes {
            color: red;
            list-style: none;
            padding-left: 0;
        }
    </style>

</head>

<body>

    <div class="container">
        <h2>用户登录</h2>

        <!-- 闪现消息 -->
        {% with messages = get_flashed_messages() %}
        {% if messages %}
        <ul class="flashes">
            {% for message in messages %}
            <li>{{ message }}</li>
            {% endfor %}
        </ul>
        {% endif %}
        {% endwith %}

        <form method="POST" action="" id="loginForm">
            <div class="form-group">
                <label>用户名：</label>
                <input type="text" name="username" required>
            </div>

            <div class="form-group">
                <label>密码：</label>
                <input type="password" name="password" required>
            </div>

            <button type="submit" class="btn-login">立即登录</button>
        </form>
    </div>
</body>

</html>